//headers 
#include<algorithm>
#include<cassert>
#include<cstdio>
#include<deque>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<deque>
#include<set>
#include<string>
#include<sstream>
#include<stack>
#include<streambuf>
#include<vector>
using namespace std;

//macros
#define LET(x,a) typeof(a) x(a)
#define FOR(i,a,n) for(LET(i,a);i!=n;i++)
#define REP(i,n) FOR(i,0,n)
#define sz size()
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define dbge(x) cout<<#x<<"->"<<x<<endl;
#define PRINT(x) REP(i,x.sz) dbge(x[i]);
#define OUT(x) x<<" "
#define LL long long
//code of suren

//arrange the numbers 


long long find_perm(int n, int k){
  LL ret = 1;
  FOR(i,1,n-k+1) ret=(ret*i)%1000000007;
  return ret;
} 

long long find_comb(int n, int k){
  LL ret = 1 ;
  FOR(i,n-k+1,n+1) ret=(ret*i)%1000000007;
  FOR(i,1,k) ret/=(k+1);
  return ret;
}

int main(){
  int t;
  cin>>t;
    REP(i,t){
    int N,M,K;
    cin>>N>>M>>K;
    LL ans = (find_perm(M,K)*find_comb(N-M,M-K))%1000000007;
    cout<<"Case "<< i+1 <<": "<<ans<<endl;
  }
  return 0;
}
